<?php
$db_connect = mysqli_connect("localhost", "root", "", "battleofthemages");
session_start();

$user = unserialize($_SESSION['user']);
$username = $user->getUsername();

$logoutQuery = "UPDATE user SET is_online=0 WHERE username=\"$username\"";
mysqli_query($db_connect, $logoutQuery);

mysqli_close($db_connect);
?>